/**
 * @author alonsocucei
 * @version 1.0
 */
package modulo1.main;

import java.util.Locale;
import modulo1.util.*;

public class DVDMenuTest {
    public static void main(String[] args) {
        final DVDMenu rootMenu = new DVDMenu("movieTitle");
        rootMenu.setRoot(true);
        
        final MenuDisplay menuDisplay = new MenuDisplay(rootMenu);
        
        DVDMenu [] rootSubMenus = {new DVDMenu("extras"),
                                   new DVDMenu("language"),
                                   new DVDMenu("subtitles")
        };
        
        rootMenu.setItems(rootSubMenus);
        
        rootSubMenus[1].setActions(new Action[]{
                                    new Action("language_english") {
                                        public void doAction() {
                                            rootMenu.setLocale(Locale.ENGLISH);
                                            menuDisplay.setLocale(Locale.ENGLISH);
                                        }
                                    },                                     
                                    new Action("language_spanish") {
                                        public void doAction() {
                                            rootMenu.setLocale(new Locale("es"));
                                            menuDisplay.setLocale(new Locale("es"));
                                        }
                                    }
                                  });
                
        menuDisplay.display();
    }
}